package com.petlab.service.impl;


import java.util.ArrayList;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.petlab.dao.RegAffairDao;
import com.petlab.model.Register;
import com.petlab.model.User;
import com.petlab.service.RegService;

@Component("regService")
public class RegServiceImpl implements RegService{
	private RegAffairDao regAffaiDao;
	
	public RegAffairDao getRegAffaiDao() {
		return regAffaiDao;
	}

	@Resource(name="regAffairDao")
	public void setRegAffaiDao(RegAffairDao regAffaiDao) {
		this.regAffaiDao = regAffaiDao;
	}

	public void add(Register register,ArrayList<User> users) {
		// TODO Auto-generated method stub
		regAffaiDao.save(register,users);	
	}
	public boolean isExists(Register register) {
		// TODO Auto-generated method stub
		return regAffaiDao.isExist(register);
	}
	
	public Register getRegPerson(String email) {
		// TODO Auto-generated method stub
		return regAffaiDao.findRegPerson(email);
	}
	public void remove(Object o) {
		// TODO Auto-generated method stub
		regAffaiDao.delete(o);
	}

}
